'''
Created on 2014-2-20

@author: lenovo
'''
def func(a, b=2, c=3, d=4): print(a, b, c, d)

#func(1, b=3, *(2,), **{'d': 4})

def gensquares(N):
    print("---start---")
    for i in range(N):
        print("---yield ---"+str(i))
        x=(yield i ** 2)
        print("---received ---"+str(x))   
        
y=gensquares(5)
print(y) 
print(next(y))
print("------------------------------------------\n")
print(y.send(50))
print("------------------------------------------\n")
print(next(y))
print("------------------------------------------\n")
print(y.next())
print(list(y))